<!-- start page number -->
<div id="page">
  %if count % pagesize == 0:
      %total =count / pagesize
  %else:
      %total = count / pagesize + 1
  %end
  %if total > 1:
      %if 'page' in currurl:
          %curl = '/'.join(currurl.split('/')[0:-1]) + '/'
      %else:
          %curl = currurl + "page/"
      %end
      %for i in range(1, total + 1):
          <div class="pagenum"><a href="{{curl}}{{i}}">{{i}}</a></div>
      %end
  %end
</div>
 <!-- end page number -->
